﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.Infrastructure;
using DLM.Domain.Model;

namespace DLM.Data.EF.CodeFirst.Mapping
{
    public class ModalityMap : EntityTypeConfiguration<Modality>
    {
        public ModalityMap()
        {
            this.HasKey(t => t.MID);
            this.ToTable("Modality");
            this.Property(t => t.MID).HasColumnName("MID");
            this.Property(t => t.PID).HasColumnName("PID");
            this.Property(t => t.Name).HasColumnName("Name").IsRequired().HasMaxLength(20);
            // this.HasRequired(t => t.PartyType).WithMany(t => t.).HasForeignKey(d => d.PID);
            //this.HasRequired(t => t.PartyType).WithMany(t => t.Modality).HasForeignKey(d => d.PID);
        }
    }
}
